package com.street.controller.user;

import com.street.dto.OrderDTO;
import com.street.result.Result;
import com.street.service.OrderService;
import com.street.vo.OrderSubmitVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/order")
public class OrderController {
    @Autowired
    OrderService orderService;

    @PostMapping("/submit")
    public Result<OrderSubmitVO> submitOrder(@RequestBody OrderDTO orderDTO){
        OrderSubmitVO vo = orderService.submit(orderDTO);
        return Result.success(vo);
    }
}
